<template>
  <div class="tongji">
    <h1>本机信息</h1>
    <h1>
      <span class="">url:</span>
      <span class="red">
        {{url}}
      </span>
    </h1>
    <h1>
      <span class="">用户地址:</span>
      <span class="red">
        {{address}}
      </span>
    </h1>
    <h1>
      <span class="">ip地址:</span>
      <span class="red">{{ip}}</span>
    </h1>
    <h1>
      <span class="">浏览器:</span>
      <span class="red">{{browser}}</span>
    </h1>
    <h1>
      <span>设备类型:</span>
      <span class="red">
        {{type}}
      </span>
    </h1>
    <h1 v-if='type=="Android"'>
      <span>设备型号</span>
      <span class="red">
        {{model}}
      </span>
    </h1>
  </div>
</template>

<script>
export default {
  data () {
    return {
      ip: '0.0.0.0',
      url: this.$tongji.getUrl(),
      address: '北京',
      browser: this.$tongji.getBrowser(),
      type: this.$tongji.getEquipmentType(),
      model: this.$tongji.getEquipmentModel(),
    }
  },
  mounted () {
    this.$tongji.getBrowser()
    var vm = this
    window.onload = function () {
      vm.address = window.returnCitySN.cname
      vm.ip = window.returnCitySN.cip
    }
  }
}
</script>
<style lang="less" scoped>
.tongji {
  width: 100%;
  h1 {
    line-height: 5rem;
    text-align: center;
    .red {
      color: red;
    }
  }
}
</style>